package org.example.controller;


import org.example.domain.entity.UserName;
import org.example.domain.model.Result;
import org.example.service.ILoginNameService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/userList")
@CrossOrigin("*")
public class UserListController {

    private ILoginNameService login;

    public UserListController (ILoginNameService login) {
        this.login = login;
    }

    @GetMapping
    public Result nameList(@RequestParam(defaultValue = "1")Integer page,
                           @RequestParam(defaultValue = "4")Integer limit){

        return login.selectAllName(page,limit);
    }
}
